/**
 * SIX VULN - http://code.google.com/p/six-vuln/
 * Copyright (C) 2006
 *   National Institute of Advanced Industrial Science and Technology (AIST)
 *   Registration Number: H20PRO-863
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package jp.go.aist.six.vuln.model.scap.vulnerability;

import java.io.Serializable;




/**
 *
 * @author	Akihito Nakamura, AIST
 * @version $Id: CweReferenceType.java 529 2013-04-15 07:08:54Z nakamura5akihito@gmail.com $
 */
public class CweReferenceType
    implements Serializable
{

    private String  id;
    //{scap-core:cweNamePatternType, required}



    /**
     * Constructor.
     */
    public CweReferenceType()
    {
    }


    public CweReferenceType(
                    final String id
                    )
    {
        setId( id );
    }


    /**
     */
    public String getId()
    {
        return id;
    }


    public void setId(
                    final String id
                    )
    {
        this.id = id;
    }



    //*********************************************************************
    //  java.lang.Object
    //*********************************************************************

    @Override
    public int hashCode()
    {
        final int  prime = 37;
        int  result = 17;

        String  id = getId();
        result = prime * result + ((id == null) ? 0 : id.hashCode());

        return result;
    }



    @Override
    public boolean equals(
                    final Object obj
                    )
    {
        if (this == obj) {
            return true;
        }

        if (!(obj instanceof CweReferenceType)) {
            return false;
        }

        CweReferenceType  other = (CweReferenceType)obj;
        final String   this_id =  this.getId();
        final String  other_id = other.getId();
        if (this_id == other_id
                        ||  (this_id != null  &&  this_id.equals( other_id ))) {
            return true;
        }

        return false;
    }



    @Override
    public String toString()
    {
        return "CweReferenceType[id=" + getId()
                        + "]";
    }

}
//CweReferenceType
